package com.gmrz.uap.model;

import com.gmrz.uap.model.base.BaseTenantConfig;

import java.util.List;

public class TenantConfig extends BaseTenantConfig<TenantConfig> {

    public static final TenantConfig dao = new TenantConfig();

    /**
     * 根据渠道ID获取渠道下渠道配置列表
     *
     * @param tenantId 渠道ID
     * @return 渠道配置信息
     */
    public List<TenantConfig> getByTenantId(String tenantId) {
        String sql = "select * from t_tenant_config where tenant_id = ?";
        return this.find(sql, tenantId);
    }

    public List<TenantConfig> getByTenantIdForUserDefault(String tenantId) {
        String sql = "select a.* from t_tenant_config a left join t_uas_config b on a.config_ename = b.config_ename where a.tenant_id = ? and b.config_user_defined = 1";
        return this.find(sql, tenantId);
    }


}
